//============================================================================
// Name        : tp.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <sstream>
#include <unistd.h>
#include <sys/types.h>

#include "CDBFrecuencias.h"
#include "CManagerTags.h"
using namespace std;
using namespace DBFrecuencias;

int main() {
	CManagerTags tm;
	CDBFrecuencias db(tm.getManagerTag());
	stringstream ss;
	string palabra;
	for(unsigned int i = 0 ; i < 10 ; i++){
		string s;
		ss.clear();
		ss << i;
		ss >> s;
		s = "Deportes0"+s;
		tm.crearTag(s);
		for(unsigned int e = 1 ; e < 10; e++){
			ss.clear();
			ss << e;
			ss >> palabra;
			palabra = "Palabra00" + palabra;
			db.incrementarFrecuencia(palabra,i, e);
			//cout << "Tag :" << i << " Palabra "  <<  e << endl;
		}
	}
	for(unsigned int i = 5 ; i < 10 ; i++){
		string s;
		ss.clear();
		ss << i;
		ss >> s;
		for(unsigned int e = 1 ; e < 10; e++){
			ss.clear();
			ss << e;
			ss >> palabra;
			palabra = "Palabra00" + palabra;
			db.decrementarFrecuencia(palabra,i, e);
			//cout << "Tag :" << i << " Palabra "  <<  e << endl;
		}
	}
	//cout << "Listo papa" << endl;
	//cout << tm.consultarNumeroPalabras(1);
	tm.eliminarTag(4);
	return 0;
}
int main1(){
	CManagerFile file;
	file.reorganizarArchivo();
	return 0;
}
